package com.wgl.yygh.controller;

import com.wgl.model.hosp.Department;
import com.wgl.model.vo.hosp.DepartmentVo;
import com.wgl.yygh.result.Result;
import com.wgl.yygh.serivce.DepartmentService;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wgl
 * @version 1.0.0
 * @ClassName DepartmentController.java
 * @Description 科室接口
 * @createTime 2022年02月07日 22:03:00
 */
//@CrossOrigin
@RequestMapping("/admin/hosp/department")
@RestController
public class DepartmentController {
    @Resource
    private DepartmentService departmentService;

   /**
   * @Author: Wgl
   * @Description: 根据医院id获得科室信息
   * @Date: 2022/2/7 22:06;
   * @param hoscode: ;
   * @return: com.wgl.yygh.result.Result;
   */
    @GetMapping("/getDepList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){

        List<DepartmentVo> list = departmentService.findeDeptTree(hoscode);

        return Result.ok(list);

    }
}
